package com.service;

import com.dao.PageDao;
import com.dao.impl.PageDaoImpl;
import com.entity.*;

public class PageSearchService {
    private PageDao pageDao;
    public PageSearchService(){
        this.pageDao=new PageDaoImpl();
    }

    public Page getPageBySearch(String name, UserCriteria userCriteria) throws Exception {
        if(name.equals("Users")){
            Page<Users> page = pageDao.getPageBySearch(name, userCriteria);
            return page;
        }else if(name.equals("book")){
            Page<Book> page = pageDao.getPageBySearch(name, userCriteria);
            return page;
        }else {
            Page<Operatebook> page = pageDao.getPageBySearch(name, userCriteria);
            return page;
        }
    }
}
